import {
  CoolController,
  BaseController,
  CoolUrlTag,
  TagTypes,
  CoolTag,
} from '@cool-midway/core';
import { Body, Get, Inject, Post, Query } from '@midwayjs/core';
import { BizCommonBaseService } from '../../../bizCommon/service/base';

/**
 * app相关接口
 */
@CoolUrlTag()
@CoolController()
export class BizCommonBaseAppController extends BaseController {
  @Inject()
  bizCommonBaseService: BizCommonBaseService;

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Get('/test', { summary: 'test' })
  public async test() {
    return this.ok({});
  }

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Get('/getBaseInf', { summary: '获取基本信息' })
  public async getBaseInf(@Query('userId') userId) {
    return this.ok(await this.bizCommonBaseService.getBaseInf(userId));
  }

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Get('/getWorkerBaseInf', { summary: '获取师傅基本信息' })
  public async getWorkerBaseInf(@Query('userId') userId) {
    return this.ok(await this.bizCommonBaseService.getWorkerBaseInf(userId));
  }

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Get('/getWorkTypeDeposit', { summary: '获取工种对应定金' })
  public async getWorkTypeDeposit(@Query('workType') workType: number) {
    return this.ok(this.bizCommonBaseService.getWorkTypeDeposit(workType));
  }
}
